﻿@model Senac.ProjetoIntegrador.ViewModel.EscolaViewModel
           
@{
    ViewBag.Title = "Create";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<h2>Create</h2>


@using (Html.BeginForm("Create", "Escola", FormMethod.Post, new { }))
{
 @Html.ValidationSummary(true)
 <fieldset>
    <legend>Dados da Escola</legend>
    <div class="editor-label">
    </div>
    <div class="editor-label">

        @Html.Label("Nome da Escola")
        @Html.EditorFor(model => model.Escola.nome_Escola) 
        <label class="asterisco">*</label>
    </div>
    <div class="editor-field">
        @Html.Label("Nome Responsável")
        @Html.EditorFor(model => model.Escola.nome_Responsavel)
        <label class="asterisco">*</label>
    </div>
</fieldset>

<fieldset>
    <legend>Dados de Login</legend>
    <div class="editor-label">
    </div>
    <div class="editor-field">
        @Html.Label("E-mail Responsável")
        @Html.EditorFor(model => model.Escola.email_Responsavel)
        <label class="asterisco">*</label>
    </div>
    <div class="editor-field">
        @Html.LabelFor(a => a.Escola.Senha)
        @Html.EditorFor(model => model.Escola.Senha)
        <label class="asterisco">*</label>
    </div>

</fieldset>   
    
    <p>
    <input type="submit" value="Salvar" />

    </p>
}


<div>
    @Html.ActionLink("Ir para a atividade", "Index", "Atividade")
</div>
     


<script type="text/javascript">

    function FctSaveEscola() {
        $.ajax({

            url: '@Url.Content("~/Escola/Create/")',
            type: 'POST',
            data: $("#FrmCadastroEscola").serialize(),
            success: function (message) { },
            error: function (a, b, c) { }
        });
    }
</script>